home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Bitmap / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  3.7 KB  |  129 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef PART_H
  13. #define PART_H
  14.  
  15. // ----- Part Layer -----
  16.  
  17. #ifndef FWPART_H
  18. #include "FWPart.h"
  19. #endif
  20.  
  21. // ----- OS Layer -----
  22.  
  23. #ifndef FWBITMAP_H
  24. #include "FWBitmap.h"
  25. #endif
  26.  
  27. #ifndef FWMENU_H
  28. #include "FWMenu.h"
  29. #endif
  30.  
  31. // ----- Foundation Layer -----
  32.  
  33. #ifndef FWBNDSTR_H
  34. #include "FWBndStr.h"
  35. #endif
  36.  
  37. #include "Defines.k"
  38.  
  39. #if FW_SUPPORTS_CYBERDOG
  40. class FW_CCyberdogHelper;
  41. #endif
  42.  
  43. //========================================================================================
  44. //    Forward Declarations
  45. //========================================================================================
  46.  
  47. class CBitmapContent;
  48.  
  49. //========================================================================================
  50. //    class CBitmapPart
  51. //========================================================================================
  52.  
  53. class CBitmapPart : public FW_CPart
  54. {
  55. //----------------------------------------------------------------------------------------
  56. //    Initialization/Destruction
  57. //
  58. public:
  59.  
  60.     FW_DECLARE_AUTO(CBitmapPart)
  61.     
  62.     CBitmapPart(ODPart* odPart);
  63.     virtual ~ CBitmapPart();
  64.     
  65.     virtual void Initialize(Environment* ev, ODStorageUnit* storageUnit, FW_Boolean fromStorage);
  66.  
  67. //----------------------------------------------------------------------------------------
  68. //    Inherited API
  69. //
  70. public:
  71.     virtual FW_CContent*        NewPartContent(Environment* ev);
  72.  
  73.     virtual FW_CFrame*            NewFrame(Environment* ev, 
  74.                                      ODFrame* odFrame, 
  75.                                      FW_CPresentation* presentation,
  76.                                         FW_Boolean fromStorage);
  77.  
  78.     virtual FW_CWindow*            NewDocumentWindow(Environment* ev);
  79.  
  80.     virtual FW_Handled            DoAbout(Environment* ev);
  81.     
  82. #if FW_SUPPORTS_CYBERDOG
  83.     // These are here for the "Reload" commands. You don't need this in your
  84.     // own part; it's just a demonstration feature in ODFBitmap.
  85.     virtual FW_Handled             DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  86.     virtual FW_Handled             DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  87.     // You'll probably want these. LoadCyberItem will be called for you when
  88.     // Cyberdog wants you to load something. GetCyberdogHelper is an accessor
  89.     // which you'll need to call from your Frame subclass.
  90.     static void                 LoadCyberItem (Environment* ev, void* selfCPart);
  91.     FW_CCyberdogHelper*            GetCyberdogHelper ();
  92.     // You've got to have this to handle Cyberdog menus properly.
  93.     void                         FocusAcquiredInFrame (Environment* ev, ODTypeToken focus, FW_CFrame* frame);
  94.     void                         FocusLostInFrame (Environment* ev, ODTypeToken focus, FW_CFrame* frame, FW_Boolean samePart);
  95. #endif
  96.     
  97. //----------------------------------------------------------------------------------------
  98. //    New API
  99. //
  100. public:
  101.     void                    UpdatePresentation(Environment* ev);
  102.     void                    AdjustFramesSize(Environment* ev);
  103.  
  104. //----------------------------------------------------------------------------------------
  105. //    Data Members
  106. //
  107. private:
  108.     CBitmapContent*            fBitmapContent;
  109.     FW_CPresentation*        fBitmapPresentation;
  110. #if FW_SUPPORTS_CYBERDOG
  111.     // This is for the "Reload" stuff, which again, you don't need in your part.
  112.     FW_Boolean                 fReloadContinuously;
  113.     // You really really need this. The helper class implements all the 
  114.     // communication with the ODF-provided SOM subclass of CyberPartExtension,
  115.     // along with some basic recipes.
  116.     FW_CCyberdogHelper*     fHelper;
  117. #endif
  118. };
  119.  
  120. #if FW_SUPPORTS_CYBERDOG
  121. inline FW_CCyberdogHelper* CBitmapPart::GetCyberdogHelper ()
  122. {
  123.     return fHelper;
  124. }
  125. #endif
  126.  
  127. #endif // PART_H
  128.  
  129.